import { apiGet , apiPost } from "@/api";


//验证码
export const getadd = query=>{
    return new Promise((resolve,reject) =>{
        apiGet('https://goods.zzgoodqc.cn/index.php/index/index/getcode',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}


//账号密码
export const postzhmm = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/index/login',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//轮播图
export const postlbt = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/getImgList',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//上传图片
export const postsc = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/upload/uploadimg',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}
//添加图片
export const posttjtp = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/addImgs',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//删除图片
export const getsc = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/delBanners',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//图片详情
export const postxq = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/getImgsbyid',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//公告列表
export const postgglb = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/getTowersList',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}


//公告添加
export const postggtj = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/addTowers',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//公告删除
export const postggsc = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/delTowers',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}

//公告详情
export const postggxq = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/hao/getTowersbyid',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}


//dianzan
export const dianzan = query=>{
    return new Promise((resolve,reject) =>{
        apiPost('https://goods.zzgoodqc.cn/index.php/index/News/newsList',query).then(res=>{
            resolve(res)
        }).catch(err =>{
            reject(err.data)
        })
    })
}



